package top.zhaojx.rpc.loadbalance;

import top.zhaojx.rpc.entity.RpcRequest;
import java.util.List;

/**
 * 负载均衡实现,用于服务消费方从多个相同的服务中选择一个
 */
public interface LoadBalancer {
    /**
     * Choose one from the list of existing service addresses list
     *
     * @param serviceAddresses Service address list
     * @return target service address
     */
    String selectServiceAddress(List<String> serviceAddresses, RpcRequest rpcRequest);
}
